<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="/style/basic_layout.css" rel="stylesheet" type="text/css">
<link href="/style/common_style.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="/js/jquery/jquery.js"></script>
<script type="text/javascript" src="/js/plugins/artDialog/jquery.artDialog.js?skin=blue"></script>
<script type="text/javascript" src="/js/plugins/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="/js/commonAll.js"></script>
<script type="text/javascript">
	$(function () {
		$(".Wdate[name='beginDate']").click(function () {
			WdatePicker({
				readOnly: true,
				maxDate: new Date()
			});
		});
		$(".Wdate[name='endDate']").click(function () {
			WdatePicker({
				readOnly: true,
				minDate: $(".Wdate[name='beginDate']").val(),
				maxDate: new Date()
			});
		});
		$("#searchForm").submit(function () {
            $(".saleByBar").click(function () {
                $.dialog.open("/chart/saleByBar.do",{
                    title: "柱状图",
                    width: "85%",
                    height: "85%",
                    lock: true,
                    resize: false,
                })
            });
        })
	});
</script>
<title>WMS-演示版</title>
<style>
	.alt td{ background:black !important;}
</style>
</head>
<body>
	<form id="searchForm" action="/chart/sale.do" method="post">
		<div id="container">
			<div class="ui_content">
				<div class="ui_text_indent">
					<div id="box_border">
						<div id="box_top">搜索</div>
						<div id="box_center">
							业务时间
							<fmt:formatDate var="beginDate" value="${qo.beginDate}" pattern="yyyy-MM-dd"/>
							<fmt:formatDate var="endDate" value="${qo.endDate}" pattern="yyyy-MM-dd"/>
							<input type="text" class="ui_input_txt01 Wdate" name="beginDate" value="${beginDate}"/> ~
							<input type="text" class="ui_input_txt01 Wdate" name="endDate" value="${endDate}"/>
							货品名称/编码
							<input type="text" class="ui_input_txt01" name="keyword" value="${qo.keyword}"/>
							客户
							<select class="ui_select01 client" name="clientId" value="${qo.clientId}">
								<option value="-1">全部客户</option>
								<c:forEach items="${clients}" var="client">
									<option value="${client.id}">${client.name}</option>
								</c:forEach>
							</select>
							品牌
							<select class="ui_select01 brand" name="brandId" value="${qo.brandId}">
								<option value="-1">全部品牌</option>
								<c:forEach items="${brands}" var="b">
									<option value="${b.id}">${b.name}</option>
								</c:forEach>
							</select>
							类型
							<select class="ui_select01 groupType" name="groupType">
								<c:forEach items="${saleMap}" var="entry">
									<option value="${entry.key}">${entry.value}</option>
								</c:forEach>
							</select>
							<script type="text/javascript">
                                //回显客户的下拉数据
                                $(".client option[value='${qo.clientId}']").prop("selected",true);
                                //回显品牌的下拉数据
                                $(".brand option[value='${qo.brandId}']").prop("selected",true);
                                //回显类型的下拉数据
								$(".groupType option[value=\"${qo.groupType}\"]").prop("selected",true);
							</script>
						</div>
						<div id="box_bottom">
							<input type="button" value="查询" class="ui_input_btn01 btn_page"/>
							<input type="button" value="柱状图" class="ui_input_btn01 saleByBar"/>
						</div>
					</div>
				</div>
			</div>
			<div class="ui_content">
				<div class="ui_tb">
					<table class="table" cellspacing="0" cellpadding="0" width="100%" align="center" border="0">
						<tr>
							<th>分组类型</th>
							<th>销售总数</th>
							<th>销售总额</th>
							<th>利润</th>
						</tr>
						<c:forEach items="${list}" var="entity" varStatus="num">
							<tr>
								<td>${entity.groupType}</td>
								<td>${entity.totalNumber}</td>
								<td>${entity.totalAmount}</td>
								<td>${entity.profit}</td>
							</tr>
						</c:forEach>
					</table>
				</div>
			</div>
		</div>
	</form>
</body>
</html>
